<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML  xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE> Jskit Test </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" type="text/css" href="../main.css" >
<script src="../../release/jskit.core.js"></script>
    <script src="../JskitConfig_doc.js"></script>
<script>
	var __ajax = null;
	function doAjax(){
		var _url = $$("#txtUrl").value;
		var _type = $$("#ddlDataType").value;
		__ajax = new JskitXmlHttpAction(_url,"doAjaxCallback",_type); 
		$$("#info").innerHTML = "正在请求链接中....";
	}
	function doAjaxCallback(data){
		__ajax = null;
		$$("#info").innerHTML = "回调成功";
		if(typeof(data)=="string"){
			$$("#info").innerHTML += "，返回字节数："+ Math.round(data.length /1024)+"KB";
		}else if(typeof(data)=="object"){
			$$("#info").innerHTML += "，返回对象";
		}else{
			$$("#info").innerHTML += "，返回了未知的内容";
		}
		$$("#mtxtResult").value = data;
	}
	function doClear(){
		$$("#mtxtResult").value="";
	}

</script>
<style>
	.regex_table{
		border:1px solid #aaaaaa;
		border-collapse:collapse;
	}
	.regex_table TD{
		border:1px solid #cccccc;
		background-color:#eeeeee;
	}
	.result_table{
		border-collapse:collapse;
	}
	.result_table TD{
		background-color:#ffffff;
		border-collapse:collapse;
	}
	TEXTAREA{
		background-color:#ffffff;
	}
	.regex_title{
		vertical-align:top;
		text-align:right;
		padding:2px 5px 2px 5px;
	}
	.result_title{
		color:#ff0000;
		width:30px;
		padding:2px 2px 2px 2px;
		background-color:#ffffff;
	}
	.result_content{
		color:#00aa00;
		padding:2px 2px 2px 2px;
		background-color:#ffffff;
	}
</style>
</HEAD>

<BODY>
	<div>
		<table class="regex_table" border="1" cellpadding="4" cellspacing="0">
			<tr>
				<td class="regex_title">URL:</td>
				<td>
					<input type="text" size="100" id="txtUrl" value="" />
				</td>
			</tr>
			<tr>
				<td class="regex_title">数据类型:</td>
				<td>
					<select id="ddlDataType">
						<option value="text">Text</option>
						<option value="xml">XML</option>
					</select>
				</td>
			</tr>
			<tr>
				<td class="regex_title">Method:</td>
				<td>
					<select id="ddlDataType">
						<option value="text">get</option>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center" style="background-color:#ffffff">
					<input type="button" value="获取" style="padding-top:2px;width:200px" onclick="doAjax()" />
					<input type="button" value="Clear" onclick="doClear()" />
				</td>
			</tr>
			<tr>
				<td colspan="2"
					<div id="info" style="text-align:center;color:#ff5500"></div>
				</td>
			</tr>
			<tr>
				<td class="regex_title">结果:</td>
				<td>
					<textarea id="mtxtResult" cols="80" rows="10"></textarea>
				</td>
			</tr>
		</table>
	</div>
</BODY>
</HTML>

